package nju.edu.desserthouse.model;

import java.io.Serializable;
import java.sql.Date;
import java.util.Calendar;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: Sale
 *
 */
@Entity
@Table(name = "sale")
public class Sale implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private long sale_id;
	private int sale_shop;
	private Date sale_date;
	private long sale_vip;
	private int sale_goods;
	private double sale_price;
	
	public Sale(){
		super();
	}
	
	@Id
	public long getId(){
		return sale_id;
	}
	
	public void setId(long sale_id){
		this.sale_id = sale_id;
	}
	
	public int getShop(){
		return sale_shop;
	}
	
	public void setShop(int sale_shop){
		this.sale_shop = sale_shop;
	}
	
	public Date getDate(){
		return sale_date;
	}
	
	public void setDate(Date sale_date){
		this.sale_date = sale_date;
	}
	
	public long getVip(){
		return sale_vip;
	}
	
	public void setVip(long sale_vip){
		this.sale_vip = sale_vip;
	}
	
	public int getGoods(){
		return sale_goods;
	}
	
	public void setGoods(int sale_goods){
		this.sale_goods = sale_goods;
	}
	
	public double getPrice(){
		return this.sale_price;
	}
	
	public void setPrice(double sale_price){
		this.sale_price = sale_price;
	}
	
	public void setIdByDate()
	{
		Calendar datetime=Calendar.getInstance();
		this.sale_id=datetime.getTimeInMillis();
	}
}
